Module: Prepare mesh

BACKGROUND

This module prepares a spatial mesh which is required to simplify the model fitting process. Instead of modelling the process across an infinite space, the mesh is used to model across the space in discrete locations (nodes) and the results in between these nodes can be interpolated from the output. In order to avoid edge effects it is necessary to extend the mesh outside of the area of interest. The number of nodes affects the time required to fit the model and a mesh with 200-300 nodes is sufficient to fit an initial model. The default settings are adjusted depending on the area of interest and for an initial model are typically suitable, but you may wish to increase the number of nodes to 2000-3000 for final model runs.

IMPLEMENTATION

The module calls disaggregation::build_mesh() which in turn calls fmesher::fm_nonconvex_hull_inla() to generate the boundary around the area of interest and fmesher::fm_mesh_2d() to generate the mesh. The {fmesher} package was spun out from the {INLA} package (Integrated Nested Laplace Approximation) and much of the literature predates this.

There are two sets of parameters that affect the density of the mesh and the boundary line drawn around the area of interest. You can generate multiple meshes using different parameters and these will all be visible in the Results panel. You can select which one to use in the model in the model in the “Selected mesh” dropdown menu once you have created at least one mesh.

The following examples were created using the Madagascar example dataset to demonstrate the effects of changing parameters on the mesh produced. The default values for Max edge and Offset are adjusted depending on the response data and so the examples are shown relative to the default values.

The Max edge parameter controls the maximum distance between nodes and has two values for controlling the parameter inside and outside of the area of interest respectively. This parameter has the largest effect on the number of nodes.

The Offset parameter affects the size of the outer mesh:

The Cutoff parameter determines the minimum distance between nodes. With the other parameters set as the default, reducing the cutoff has no effect, but increasing it removes some of the small triangles around the boundary:

In most cases, the boundary parameters (Convex, Concave and Resolution) do not need altering, but if you wish to modify them, toggle the “Change boundary parameters” switch. These parameters affect the shape of the boundary.

Convex

Concave

Resolution affects the distance between nodes on the boundary and so higher values increase the number of total nodes:

REFERENCES

  1. Lindgren F., Rue, H. (2015). Bayesian Spatial Modelling with R-INLA . Journal of Statistical Software, 63(19) DOI: 10.18637/jss.v063.i19

  2. Krainski, E. T. et al. (2019). Triangulation details and examples in Advanced Spatial Modeling with Stochastic Partial Differential Equations Using R and INLA. Chapman & Hall/CRC Press. Boca Raton, FL.